package com.wolfking.jeesite.sso;

import com.wolfking.jeesite.util.RequestUtil;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;

public interface SsoLoginUrlHandler {

    default String assemblySsoLoginUrl(String ssoLoginUrl, HttpServletRequest request) {
        if (StringUtils.isNoneBlank(ssoLoginUrl)) {
            return ssoLoginUrl + "?service=" + RequestUtil.getRequestUrlEncode(request, "ticket");
        } else {
            return "";
        }
    }
}
